Same fix as #923.
Closes #1138
use cargo::ops;
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};
-use cargo::util::important_paths::find_root_manifest_for_cwd;
#[derive(RustcDecodable)]
struct Options {
pub fn execute(options: Options, shell: &mut MultiShell) -> CliResult<Option<()>> {
shell.set_verbose(options.flag_verbose);
- let root = try!(find_root_manifest_for_cwd(None));
- try!(ops::yank(&root, shell,
+ try!(ops::yank(shell,
options.arg_crate,
options.flag_vers,
options.flag_token,
Ok(())
}
-pub fn yank(manifest_path: &Path,
- shell: &mut MultiShell,
+pub fn yank(shell: &mut MultiShell,
krate: Option<String>,
version: Option<String>,
token: Option<String>,
let name = match krate {
Some(name) => name,
None => {
+ let manifest_path = try!(find_root_manifest_for_cwd(None));
let mut src = try!(PathSource::for_path(&manifest_path.dir_path()));
try!(src.update());
let pkg = try!(src.get_root_package());
use std::io::fs::{mkdir_recursive, rmdir_recursive, PathExtensions};
use rustc_serialize::{Encodable, Encoder};
use url::Url;
-use git2::{mod, ObjectType};
+use git2::{self, ObjectType};
use core::GitReference;
use util::{CargoResult, ChainError, human, ToUrl, internal};